package com.xiyoukt.springboot.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

/**
 * Description: springboot
 * ********************************************************
 * *                                                      *
 * *                     xiyoukt.com                      *
 * *          西游课堂 - Java程序猿的在线学习课堂          *
 * *                                                      *
 * ********************************************************
 * Created by xiyoukt on 2018/9/23 18:17
 */
//@Getter
//@Setter
//@Value
//    @ToString(includeFieldNames = false, exclude = "age", doNotUseGetters = true, callSuper = true)
//@EqualsAndHashCode
//@Data(staticConstructor = "UserFactory")
@Data
    @AllArgsConstructor
    @NoArgsConstructor
//    @RequiredArgsConstructor
@ApiModel
public class User {

//    @NonNull 使用这个注解，会在构造函数中加入这个参数，也会在settr方法中判断是否为null
    @ApiModelProperty(name = "name", value = "用户名", required = true)
    private String name;

    @NonNull
    @ApiModelProperty(name = "age", value = "年龄", required = true)
    private Integer age;

    // final修饰的字段，必须有一个初始值，或者在构造函数中给他设置，否则会报错
//    private final Integer gender;
    @ApiModelProperty(name = "gender", value = "性别", required = true)
    private Integer gender;

}
